<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html>
<html>
	<head>
		<title>提现订单查询</title>
		<jsp:include page="../inc_min.jsp"></jsp:include>
		<jsp:include page="../inc_bootstrap.jsp"></jsp:include>
		<link rel="stylesheet" href="${ctx }/css/settlementQuery.css"/>
		<link rel="stylesheet" href="${ctx}/css/iconfont.css"/>
		<script type="text/javascript">
		//查看电子对账单
		function elecAccount(cashNo){
			//alert(cashNo);
			layer.open({
				type: 2,
				title: ['对账查看','background-color:#28aaf0; color:#fff;'],
				shadeClose: true,
				shade: 0.3,
				area: ['658px', '400px'],  
				content: ['${ctx}/statement/toStatementDetail?cashNo='+cashNo,"no"]  // iframe的url，no代表不显示滚动条
				
			});
		};
		//查看详情
		function viewDetail(cashNo){
		
			layer.open({
				type: 2,
				title: ['提现单详情','background-color:#28aaf0; color:#fff;'],
				shadeClose: true,
				shade: 0.3,
				yes: function(index, layero) {
					layer.close(index);
				},
				btn2: function(index, layero) {
					//取消的回调
				},
				area: ['800px', '600px'],
				content: ['${ctx}/statement/settlementOrderPage/'+cashNo], //iframe的url，no代表不显示滚动条
				success: function(layero, index){
				},
				end:function(){
				}
			});
		};
		//背景变蓝  文字变白
		/* function change(arg){
			arg.
		}; */
		
		$(function(){	
			//状态背景文字切换
			$(".listArg").click(function(){
				$(".listArg").css({
					"background": "#f1f1f1",
					"color": "black"
				});
				$(this).css({
					"background": "#28aaf0",
					"color": "#FFFFFF"
				});
			});
			//全选
			 $("#query").click(function (){
                 gridSearch('');
             });
            //加载列表信息
            $('#bootTable').bootstrapTable({
                url: '${ctx}/withdrawal/find?temp='+Math.random(),
                dataType: "json",
                //contentType: "application/x-www-form-urlencoded",
                method: 'get',
                cache: false,
                height: "auto",//
                pagination: true,
                pageSize: 20,
                pageNumber:1,
                pageList: [ 20, 50, 100, 200, 500],
                striped: false,
                search: false,
                showColumns: false,
                showRefresh: false,
                clickToSelect: true,
                idField:'id',
                //toolbar: "#toolbar",
                paginationHAlign: 'left',
                paginationDetailHAlign: 'right',
                sidePagination: "server", //表示服务端请求
                queryParamsType : "undefined",
                //queryParams: queryParams,//参数
                columns: [
                    {field:"id",title:"",align:"left",valign:"middle",visible:false},
                    {field:"cashNo",title:"提现单号",align:"left",valign:"middle"},
                    {field:"cashMoney",title:"申请提现金额",align:"left",valign:"middle"},
                    {field:"applyTime",title:"申请提现时间",align:"left",valign:"middle"},
                    {field:"status",title:"财务状态",align:"left",valign:"middle",
                        formatter:function(value,row,index){
                        var str=CommonConverter.toOrderPayStatusStr(row.status);
                        return str;
                    }},
                    {field:"act",title:"操作",align:"center",valign:"middle",
                        formatter: function(value, row, index) {
                            var str='';
                            //str += '<span class="mynewBtn" style="height:30px;line-height:30px;min-width:75px;" onclick=viewDetail("'+row.cashNo+'"); >查看详情</span>';
                            str += '<i class="icon iconfont position" title="详情" onclick=viewDetail("'+row.cashNo+'")>&#xe62d;</i>';
                            if(row.status==6){
                                //str+='<span class="mynewBtn" style="height:30px;line-height:30px;min-width:75px;" onclick=elecAccount("'+row.cashNo+'"); >查看对账单</span>';
                                str += '<i class="icon iconfont position" title="对账单" onclick=elecAccount("'+row.cashNo+'")>&#xe61c;</i>';
                            }
                            return str;
                        }
                    }
                ],
                formatNoMatches: function(){
                    return '无符合条件的记录';
                }
            });
        });
            function gridSearch(status) {
                var cashNo="";//提现单号
                var startDate="";//申请日期
                var endDate="";//结束日期
                cashNo=$("#cashNo").val();
                startDate=$("#startDate").val();
                endDate=$("#endDate").val();
                var param = {query:{
                    pageNumber: 1,
                    pageSize: 20,
                    cashNo:cashNo,
                    startTime:startDate,
                    endTime:endDate,
                    status:status
                }};
                $('#bootTable').bootstrapTable('refresh',param);
            }
		</script>
	</head>
	<body>
    <jsp:include page="../head.jsp"/>
		<div class="content">
			 <ul class="list">
	            <li>提现单号：<input type="text" style="height:22px" id="cashNo"/></li>           
	            <li>
	               	 申请日期：
	                <input type="text" id="startDate" class="Wdate" style="height:22px;" value="${requestScope.deptDate}" onFocus="new WdatePicker({dateFmt:'yyyy-MM-dd'/*,minDate:'%y-%M-\#{%d+2}',maxDate:'#F{$dp.$D(\'endDate\')}'*/})"/>
					&nbsp;&nbsp;&nbsp;&nbsp;
					至<input type="text" id="endDate" class="Wdate" style="height:22px;" value="${requestScope.endDate}" onFocus="new WdatePicker({dateFmt:'yyyy-MM-dd'/*,minDate:'#F{$dp.$D(\'startDate\')}'*/})">
	            </li>
	             <li class="right">
	            	<input type="button" value="查询" class="mynewBtn" id="query"/>
	            </li>
	         </ul>
	         <ul class="list conditionList">
	         	<li>状态：</li>
				<li  class="listArg allStatus" ><span onclick="gridSearch('')">全部</span></li>
				<li class="listArg " onclick="gridSearch('4')" >
					<span >提现待审核</span>
				</li>
				<li class="listArg " onclick="gridSearch('5')">
					<span >提现待支付</span>
				</li>
				<li class="listArg " onclick="gridSearch('6')">
					<span >已付款</span>
				</li>
			</ul>
			<div class="setTabBox">
                <table id="bootTable"></table>
			</div>
	         
		</div>
    <jsp:include page="../footer.jsp"/>
	</body>
</html>